<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/apsproject/schedule/Aps_DistributedTask.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/apsproject/schedule/Aps_DistributedTask.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Aps_DistributedTask",
        setup() {
            const table = ref({
                key: "DistributedTaskId",
                footer: "Foots",
                cnName: "排程任务",
                name: "schedule/Aps_DistributedTask",
                newTabEdit: false,
                url: "/Aps_DistributedTask/",
                sortName: "SalesOrderId,StartTime"
            });
            const editFormFields = ref({"SalesOrderId":"","MachineId":"","GroupId":"","MoCode":"","ProductsCode":"","Qty":"","Weight":"","DeadLine":"","StartTime":"","EndTime":"","PreMoCode":"","Status":"","RouteNameId":"","StepSequence":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"APS_Order","data":[],"title":"生产订单","field":"SalesOrderId","type":"select"},
                               {"dataKey":"BASE_Machine","data":[],"title":"设备","field":"MachineId","type":"select"}],
                              [{"dataKey":"BASE_Group","data":[],"title":"工序","field":"GroupId","type":"select"},
                               {"title":"工单号","field":"MoCode","type":"text"}],
                              [{"title":"产品","field":"ProductsCode"},
                               {"title":"产品数量","field":"Qty","type":"decimal"}],
                              [{"title":"产品重量","field":"Weight","type":"decimal"},
                               {"title":"出货日","field":"DeadLine","type":"datetime"}],
                              [{"title":"开始时间","field":"StartTime","type":"datetime"},
                               {"title":"结束时间","field":"EndTime","type":"datetime"}],
                              [{"title":"投料批号","field":"PreMoCode","type":"text"},
                               {"dataKey":"APS_TaskStatus","data":[],"title":"状态","field":"Status","type":"select"}],
                              [{"dataKey":"BASE_Route","data":[],"title":"工艺ID","field":"RouteNameId","type":"select"},
                               {"title":"工站顺序","field":"StepSequence","type":"number"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"SalesOrderId":"","MachineId":"","MoCode":"","Status":""});
            const searchFormOptions = ref([[{"dataKey":"APS_Order","data":[],"title":"生产订单","field":"SalesOrderId","type":"select"},{"dataKey":"BASE_Machine","data":[],"title":"设备","field":"MachineId","type":"select"}],[{"title":"工单号","field":"MoCode"},{"dataKey":"APS_TaskStatus","data":[],"title":"状态","field":"Status","type":"select"}]]);
            const columns = ref([{field:"SalesOrderId",title:"生产订单",type:"bigint",bind:{ key:"APS_Order",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ScheduleVersionId",title:"排程版本ID",type:"bigint",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"DistributedTaskId",title:"ID",type:"bigint",bind:{ key:"APS_SchudeVersion",data:[]},width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MachineId",title:"设备",type:"bigint",bind:{ key:"BASE_Machine",data:[]},width:160,showOverflowTooltip:true,align:"left"},
                       {field:"GroupId",title:"工序",type:"bigint",bind:{ key:"BASE_Group",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"MoCode",title:"工单号",type:"string",width:90,showOverflowTooltip:true,align:"left"},
                       {field:"PreMoCode",title:"投料批号",type:"string",width:90,showOverflowTooltip:true,align:"left"},
                       {field:"Status",title:"状态",type:"int",bind:{ key:"APS_TaskStatus",data:[]},width:90,showOverflowTooltip:true,align:"left"},
                       {field:"ProductsCode",title:"产品",type:"string",width:180,showOverflowTooltip:true,align:"left"},
                       {field:"UPH",title:"小时产能",type:"decimal",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"OutputCircle",title:"产出节拍",type:"decimal",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Qty",title:"产品数量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Weight",title:"产品重量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"DeadLine",title:"出货日",type:"datetime",width:160,showOverflowTooltip:true,align:"left"},
                       {field:"StartTime",title:"开始时间",type:"datetime",width:160,showOverflowTooltip:true,align:"left"},
                       {field:"EndTime",title:"结束时间",type:"datetime",width:160,showOverflowTooltip:true,align:"left"},
                       {field:"Seq",title:"顺序",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsNew",title:"新版本中新增标识",type:"int",bind:{ key:"enabled",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsFinish",title:"标识能否排完",type:"int",bind:{ key:"enabled",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"FinishStatus",title:"0可按时达成 1可提前达成 2无法按时达成",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"FinishedQty",title:"完成的数量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"FinishedWeight",title:"完成的重量",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"BeforeMinutes",title:"前置时长分钟",type:"decimal",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"PreparationMinutes",title:"准备时长分钟",type:"decimal",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"RouteNameId",title:"工艺ID",type:"bigint",bind:{ key:"BASE_Route",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"StepSequence",title:"工站顺序",type:"int",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"AfterMinutes",title:"后置时长分钟",type:"decimal",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:160,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:160,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"ScheduleTaskId",title:"ScheduleTaskId",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
